<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8" isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 
<style>
.editor table {
	display: inline;
	vertical-align: top;
}
</style>
<div class="r_location">
	<i class="r_txtico"></i> 内容管理&gt; 首页广告管理 &gt; 修改广告
</div>
<form id="add_form"  method="post" enctype="multipart/form-data" action="cms/advertise/modify">
    <input type="hidden" value="${data.id}" name="id"/>
  <ul class="all_list">
		<li>
			<span class="all_title">广告名称：</span>
			<span>
				<input class="ui_input" id="adName" value="${data.adName}" validator='{"label":"广告名称","required":true,"maxLength":20}' name="adName" style="width:300px;">
			</span>
		</li>
		<li>
			<span class="all_title">是否显示：</span>
			<span>
			     <input type="radio"  name="status" value="1" <c:if test="${data.status=='1'}">checked="checked"</c:if> >显示
				 <input type="radio"  name="status" value="0" <c:if test="${data.status=='0'}">checked="checked"</c:if> >隐藏
			</span>
		</li>
		<li>
			<span class="all_title">排序：</span>
			<span>
				<input class="ui_input" id="showIndex" value="${data.showIndex}" validator='{"label":"排序","maxLength":4,"isDigit":true}'  name="showIndex" style="width:100px;">
			</span> 
		</li>
		<li>
			<span class="all_title">衔接地址 ：</span>
			<span>
				 <input class="ui_input" id="linkUrl" value="${data.linkUrl}" validator='{"label":"衔接地址 ","required":true,"maxLength":200}' name="linkUrl" style="width:300px;">
			</span>
		</li>
		<li>
			<span class="all_title">广告图片：</span>
			<span><input multiple type="file"  id="imgUrl"  name="imgUrl"  onchange="previewProductImage(this)"></span>
		</li>
		<li>
			<span class="all_title"></span>
			<span id="preview"><img id="imghead" border=0 src="${data.imgUrl}" width="100" height="70" /></span>
		</li>
		<li class="m-t10">
			<span class="all_title">衔接详细内容：</span>
			<span >
				<textarea rows="4" cols="98" name="text" validator='{"label":"问题描述"}' id="text_textarea">${data.text}</textarea>
			</span>
		</li>
		<li>
			<span class="all_title"></span>
			<span> 
				<input type="button" id="save_button" value="修改" class="submit_btn m-r15 submitBtn">
			</span>
		</li>
	</ul> 
</form>
<script type="text/javascript">
	$(function(){
		 
		function showDialog(url, options) {
			myDialog = art.dialog(options);// 初始化一个带有loading图标的空对话框
			$.post(url, options.param, function(data) {
				myDialog.content(data);
			});
		}
		$("#add_form").validator({},{
			callback:function(result){
				// 校验相关的图片是否为空
				$("#add_form").ajaxSubmit(function(json){
					if(json.success=='succeed'){
						art.dialog({icon: 'succeed',content: json.message,lock:true});
						to_page('/cms/advertise/view/page');
					}else{
						art.dialog({icon: 'error',content: json.message,lock:true});
					}
				});
			}
		});
	});
</script>